import request from '@/config/axios'

export interface StoreCommissionWithdrawVO {
  id: number
  storeId: number
  storeName: string
  price: number
  feePrice: number
  totalPrice: number
  type: number // 1钱包，2银行卡，3收款码
  name?: string
  accountNo?: string
  bankName?: string
  bankAddress?: string
  accountQrCodeUrl?: string
  status: number
  auditReason?: string
  auditTime?: Date
  remark?: string
  transferVoucher?: string
  transferTime?: Date
  createTime: Date
}

// 查询门店佣金提现分页
export const getStoreCommissionWithdrawPage = async (params: any) => {
  return await request.get({ url: `/trade/store-commission-withdraw/page`, params })
}

// 查询门店佣金提现详情
export const getStoreCommissionWithdraw = async (id: number) => {
  return await request.get({ url: `/trade/store-commission-withdraw/get?id=` + id })
}

// 门店佣金提现 - 审核通过
export const approveStoreCommissionWithdraw = async (id: number) => {
  return await request.put({ url: `/trade/store-commission-withdraw/approve?id=` + id })
}

// 门店佣金提现 - 审核驳回
export const rejectStoreCommissionWithdraw = async (data: StoreCommissionWithdrawVO) => {
  return await request.put({ url: `/trade/store-commission-withdraw/reject`, data })
}

// 门店佣金提现 - 确认转账成功
export const confirmTransferSuccess = async (data: { 
  id: number; 
  transferVoucher: string; 
  transferTime?: string;
}) => {
  return await request.put({ url: `/trade/store-commission-withdraw/success`, data })
} 
